package com.example.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
//评论
public class Comment implements Serializable {
    private Integer id;
    private String content;
    private Integer userId;
    private Integer postId;
    private Integer parentId;
    private Date createTime;
    private String status;
    private List<Comment> replies;
    private String username; // 评论人用户名
    private Integer likeCount; // 点赞数
    private Boolean isLiked; // 当前用户是否已点赞

    // 构造方法
    public Comment() {}

    // Getter 和 Setter 方法
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }

    public String getContent() { return content; }
    public void setContent(String content) { this.content = content; }

    public Integer getUserId() { return userId; }
    public void setUserId(Integer userId) { this.userId = userId; }

    public Integer getPostId() { return postId; }
    public void setPostId(Integer postId) { this.postId = postId; }

    public Integer getParentId() { return parentId; }
    public void setParentId(Integer parentId) { this.parentId = parentId; }

    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }

    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }

    public List<Comment> getReplies() { return replies; }
    public void setReplies(List<Comment> replies) { this.replies = replies; }

    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }

    public Integer getLikeCount() { return likeCount; }
    public void setLikeCount(Integer likeCount) { this.likeCount = likeCount; }

    public Boolean getIsLiked() { return isLiked; }
    public void setIsLiked(Boolean isLiked) { this.isLiked = isLiked; }

    @Override
    public String toString() {
        return "Comment{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", userId=" + userId +
                ", postId=" + postId +
                ", parentId=" + parentId +
                ", createTime=" + createTime +
                ", status='" + status + '\'' +
                ", username='" + username + '\'' +
                ", likeCount=" + likeCount +
                ", isLiked=" + isLiked +
                '}';
    }
}
